extends "../calxJS_Hide/calxJS_Hide.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "小山脉"                   # 角色的名称
	attCoe.atkRan = 1                 # 攻击距离
	attCoe.maxHp = 6.9                  # 最大生命（每点代表112.5基础数值，取整数，下同）
	attCoe.atk = 6.5                    # 攻击力（每点代表8.5）
	attCoe.mgiAtk = 2.5                 # 魔法攻击（每点代表13.7）
	attCoe.def = 6                    # 物理防御（每点代表15）
	attCoe.mgiDef = 4                 # 魔法防御（每点代表16.6）
	atkEff = "atk_dang" 
	xb = "水"
	lv = 3   
	addSkillTxt("[山魂咆哮]移动躯体挥出沉重的一拳攻击敌方单体，造成120%的物理伤害\n15%概率提升双攻双防攻速暴击10%，最高60%[CD:6]") 
	addSkillTxt("[铜墙铁壁]<先发>进入防御姿态，提升自身物防20%，最高60%[CD:8]")
	addSkillTxt("[山魂震慑]爆发山魂之力攻击敌方单体，造成130%水系物理伤害，提升10%物攻\n进入元素庇护状态[CD:12]")
	addCdSkill("shpx",6)
	addCdSkill("tqtb",8)
	addCdSkill("shzs",12)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "shpx":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("山魂咆哮", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,att.atk*1.2,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		if sys.rndPer(15):
			var bf2 = hasBuff("wugong1")
			var buff1 = hasBuff("mogong1")
			var buff2 = hasBuff("wukang1")
			var buff3 = hasBuff("mokang1")
			var buff4 = hasBuff("gongsu1")
			var buff5 = hasBuff("baoji1")
			if bf2 == null:
				addBuff(wugong1.new())
			elif bf2.att.atkL < 0.6:
				bf2.att.atkL += 0.1
			else:
				pass
			if buff1 ==null:
				addBuff(bf.mogong1.new())
			elif buff1.att.mgiAtkL < 0.6:
				buff1.att.mgiAtkL += 0.1
			if buff2 ==null:
				addBuff(bf.wukang1.new())
			elif buff2.att.defL < 0.6:
				buff2.att.defL += 0.1
			if buff3 ==null:
				addBuff(bf.mokang1.new())
			elif buff3.att.mgiDefL < 0.6:
				buff3.att.mgiDefL += 0.1
			if buff4 ==null:
				addBuff(gongsu1.new())
			elif buff4.att.spd < 0.6:
				buff4.att.spd += 0.1
			if buff5 ==null:
				addBuff(bf.baoji1.new())
			elif buff5.att.cri < 0.6:
				buff5.att.cri += 0.1
	if id == "tqtb":
		tqtb()
		yield(reTimer(0.2),"timeout")
		tqtb()
	if id == "shzs":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("山魂震慑", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,att.atk*2,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		var buff = hasBuff("wugong1")
		if buff == null:
			addBuff(bf.wugong1.new())
		elif buff.att.atkL < 0.6:
			buff.att.atkL += 0.1
		addBuff(bihu.new(6))

func tqtb():
	var buff = hasBuff("wukang1")
	if buff == null:
		addBuff(bf.wukang1.new())
	elif buff.att.defL < 0.6:
		buff.att.defL += 0.1

func _onBattleStart():
	._onBattleStart()
	tqtb()
	yield(reTimer(0.2),"timeout")
	tqtb()

class bihu:
	extends Buff
	var dispelable = false
	func _init(lv = 1):
		attInit()
		id = "bihu"
		life = lv
		isNegetive=false
	func _upS():
		._upS()
		masCha.plusHp(att.maxHp*0.03)

class wugong1:
	extends Buff
	func _init():
		attInit()
		var dispelable = false
		id = "wugong1"	
		att.atkL += 0.1

class gongsu1:
	extends Buff
	func _init():
		attInit()
		var dispelable = false
		id = "gongsu1"	
		att.spd += 0.1